<?php

class IndexAction extends Action{
	//初始化数据
	public function index(){
		for ($i=0;$i<10;$i++){
			$res[$i] = rand(100, 400);
		}
		$this->assign('height', $res);
		$this->display();
	}
	
	//获取下一栏数据
	public function getMore(){
		for ($i=0;$i<6;$i++){
			$res[$i] = rand(100, 400);
		}
		$this->ajaxReturn($res);
	}
	
	//初始化数据
	public function useDb(){
		$list = M('Pubuliu')->order('id DESC')->limit(10)->select();
		$this->assign('list', $list);
		$this->display();
	}
	
	//获取下一栏数据
	public function getDbMore(){
		$last_id = $this->_get('last_id');
        $map['id'] = array('lt', $last_id);
        $list = D('Pubuliu')->where($map)->order('id DESC')->limit(3)->select();
        $this->ajaxReturn($list);
	}
	
}